package com.socix.database;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;

import java.sql.CallableStatement;
import java.sql.Clob;
import java.sql.ParameterMetaData;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Date;
import java.sql.Array;
import java.sql.Blob;
import java.sql.SQLWarning;
import java.sql.Time;
import java.sql.Timestamp;

import java.util.Calendar;
import java.util.Map;


public class ICallableStatement {
    public static int CLOSE_ALL_RESULTS = CallableStatement.CLOSE_ALL_RESULTS;
    public static int CLOSE_CURRENT_RESULT = CallableStatement.CLOSE_CURRENT_RESULT;
    public static int EXECUTE_FAILED = CallableStatement.EXECUTE_FAILED;
    public static int KEEP_CURRENT_RESULT = CallableStatement.KEEP_CURRENT_RESULT;
    public static int NO_GENERATED_KEYS = CallableStatement.NO_GENERATED_KEYS;
    public static int RETURN_GENERATED_KEYS = CallableStatement.RETURN_GENERATED_KEYS;
    public static int SUCCESS_NO_INFO = CallableStatement.SUCCESS_NO_INFO;
    private CallableStatement cstate;
    private IConnection conn;
    private String eid;
    private boolean lock = false;
    private long invokeTime = -1;

    ICallableStatement(IConnection conn, CallableStatement cstate) {
        this.conn = conn;
        this.cstate = cstate;
        this.eid = this.conn.getEID();
        this.invokeTime = System.currentTimeMillis();
    }

    String getEID() {
        return this.eid;
    }

    void setLock(boolean lock) {
        this.lock = lock;
    }

    boolean isLocked() {
        return this.lock;
    }

    long getInvokeTime() {
        return this.invokeTime;
    }

    public void close() throws SQLException {
        try {
            this.conn.closeCallableStatement(this);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    void destroy() throws SQLException {
        try {
            this.cstate.close();
            this.invokeTime = -1;
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void addBatch() throws SQLException {
        try {
            this.cstate.addBatch();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void addBatch(String sql) throws SQLException {
        try {
            this.cstate.addBatch(sql);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void cancel() throws SQLException {
        try {
            this.cstate.cancel();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void clearBatch() throws SQLException {
        try {
            this.cstate.clearBatch();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void clearParameters() throws SQLException {
        try {
            this.cstate.clearParameters();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void clearWarnings() throws SQLException {
        try {
            this.cstate.clearWarnings();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean execute() throws SQLException {
        try {
            return this.cstate.execute();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean execute(String sql) throws SQLException {
        try {
            return this.cstate.execute(sql);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean execute(String sql, int autoGeneratedKeys)
        throws SQLException {
        try {
            return this.cstate.execute(sql, autoGeneratedKeys);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean execute(String sql, int[] columnIndexes)
        throws SQLException {
        try {
            return this.cstate.execute(sql, columnIndexes);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean execute(String sql, String[] columnNames)
        throws SQLException {
        try {
            return this.cstate.execute(sql, columnNames);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int[] executeBatch() throws SQLException {
        try {
            return this.cstate.executeBatch();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public ResultSet executeQuery() throws SQLException {
        try {
            return this.cstate.executeQuery();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public ResultSet executeQuery(String sql) throws SQLException {
        try {
            return this.cstate.executeQuery(sql);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int executeUpdate() throws SQLException {
        try {
            return this.cstate.executeUpdate();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int executeUpdate(String sql) throws SQLException {
        try {
            return this.cstate.executeUpdate(sql);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int executeUpdate(String sql, int autoGeneratedKeys)
        throws SQLException {
        try {
            return this.cstate.executeUpdate(sql, autoGeneratedKeys);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int executeUpdate(String sql, int[] columnIndexes)
        throws SQLException {
        try {
            return this.cstate.executeUpdate(sql, columnIndexes);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int executeUpdate(String sql, String[] columnNames)
        throws SQLException {
        try {
            return this.cstate.executeUpdate(sql, columnNames);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Array getArray(int i) throws SQLException {
        try {
            return this.cstate.getArray(i);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Array getArray(String parameterName) throws SQLException {
        try {
            return this.cstate.getArray(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public BigDecimal getBigDecimal(int parameterIndex)
        throws SQLException {
        try {
            return this.cstate.getBigDecimal(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    /*
        public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException {
            try {
                return this.cstate.getBigDecimal(parameterIndex, scale);
            }catch(Exception ex) {
                throw new SQLException(ex);
            }
        }
    */
    public BigDecimal getBigDecimal(String parameterName)
        throws SQLException {
        try {
            return this.cstate.getBigDecimal(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Blob getBlob(int i) throws SQLException {
        try {
            return this.cstate.getBlob(i);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Blob getBlob(String parameterName) throws SQLException {
        try {
            return this.cstate.getBlob(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean getBoolean(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getBoolean(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean getBoolean(String parameterName) throws SQLException {
        try {
            return this.cstate.getBoolean(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public byte getByte(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getByte(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public byte getByte(String parameterName) throws SQLException {
        try {
            return this.cstate.getByte(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public byte[] getBytes(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getBytes(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public byte[] getBytes(String parameterName) throws SQLException {
        try {
            return this.cstate.getBytes(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Clob getClob(int i) throws SQLException {
        try {
            return this.cstate.getClob(i);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Clob getClob(String parameterName) throws SQLException {
        try {
            return this.cstate.getClob(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public IConnection getConnection() throws SQLException {
        try {
            return this.conn;
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Date getDate(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getDate(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Date getDate(int parameterIndex, Calendar cal)
        throws SQLException {
        try {
            return this.cstate.getDate(parameterIndex, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Date getDate(String parameterName) throws SQLException {
        try {
            return this.cstate.getDate(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Date getDate(String parameterName, Calendar cal)
        throws SQLException {
        try {
            return this.cstate.getDate(parameterName, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public double getDouble(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getDouble(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public double getDouble(String parameterName) throws SQLException {
        try {
            return this.cstate.getDouble(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getFetchDirection() throws SQLException {
        try {
            return this.cstate.getFetchDirection();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getFetchSize() throws SQLException {
        try {
            return this.cstate.getFetchSize();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public float getFloat(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getFloat(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public float getFloat(String parameterName) throws SQLException {
        try {
            return this.cstate.getFloat(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public ResultSet getGeneratedKeys() throws SQLException {
        try {
            return this.cstate.getGeneratedKeys();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getInt(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getInt(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getInt(String parameterName) throws SQLException {
        try {
            return this.cstate.getInt(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public long getLong(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getLong(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public long getLong(String parameterName) throws SQLException {
        try {
            return this.cstate.getLong(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getMaxFieldSize() throws SQLException {
        try {
            return this.cstate.getMaxFieldSize();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getMaxRows() throws SQLException {
        try {
            return this.cstate.getMaxRows();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public ResultSetMetaData getMetaData() throws SQLException {
        try {
            return this.cstate.getMetaData();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean getMoreResults() throws SQLException {
        try {
            return this.cstate.getMoreResults();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean getMoreResults(int current) throws SQLException {
        try {
            return this.cstate.getMoreResults(current);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public ParameterMetaData getParameterMetaData() throws SQLException {
        try {
            return this.cstate.getParameterMetaData();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Object getObject(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getObject(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Object getObject(int i, Map<String, Class<?>> map) throws SQLException {
        try {
            return this.cstate.getObject(i, map);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Object getObject(String parameterName) throws SQLException {
        try {
            return this.cstate.getObject(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Object getObject(String parameterName, Map<String, Class<?>> map)
        throws SQLException {
        try {
            return this.cstate.getObject(parameterName, map);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getQueryTimeout() throws SQLException {
        try {
            return this.cstate.getQueryTimeout();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Ref getRef(int i) throws SQLException {
        try {
            return this.cstate.getRef(i);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Ref getRef(String parameterName) throws SQLException {
        try {
            return this.cstate.getRef(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public ResultSet getResultSet() throws SQLException {
        try {
            return this.cstate.getResultSet();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getResultSetConcurrency() throws SQLException {
        try {
            return this.cstate.getResultSetConcurrency();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getResultSetHoldability() throws SQLException {
        try {
            return this.cstate.getResultSetHoldability();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getResultSetType() throws SQLException {
        try {
            return this.cstate.getResultSetType();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public short getShort(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getShort(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public short getShort(String parameterName) throws SQLException {
        try {
            return this.cstate.getShort(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public String getString(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getString(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public String getString(String parameterName) throws SQLException {
        try {
            return this.cstate.getString(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Time getTime(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getTime(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Time getTime(int parameterIndex, Calendar cal)
        throws SQLException {
        try {
            return this.cstate.getTime(parameterIndex, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Time getTime(String parameterName) throws SQLException {
        try {
            return this.cstate.getTime(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Time getTime(String parameterName, Calendar cal)
        throws SQLException {
        try {
            return this.cstate.getTime(parameterName, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Timestamp getTimestamp(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getTimestamp(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Timestamp getTimestamp(int parameterIndex, Calendar cal)
        throws SQLException {
        try {
            return this.cstate.getTimestamp(parameterIndex, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Timestamp getTimestamp(String parameterName)
        throws SQLException {
        try {
            return this.cstate.getTimestamp(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public Timestamp getTimestamp(String parameterName, Calendar cal)
        throws SQLException {
        try {
            return this.cstate.getTimestamp(parameterName, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public int getUpdateCount() throws SQLException {
        try {
            return this.cstate.getUpdateCount();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public URL getURL(int parameterIndex) throws SQLException {
        try {
            return this.cstate.getURL(parameterIndex);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public URL getURL(String parameterName) throws SQLException {
        try {
            return this.cstate.getURL(parameterName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public SQLWarning getWarnings() throws SQLException {
        try {
            return this.cstate.getWarnings();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void registerOutParameter(int parameterIndex, int sqlType)
        throws SQLException {
        try {
            this.cstate.registerOutParameter(parameterIndex, sqlType);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void registerOutParameter(int parameterIndex, int sqlType, int scale)
        throws SQLException {
        try {
            this.cstate.registerOutParameter(parameterIndex, sqlType, scale);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void registerOutParameter(int paramIndex, int sqlType,
        String typeName) throws SQLException {
        try {
            this.cstate.registerOutParameter(paramIndex, sqlType, typeName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void registerOutParameter(String parameterName, int sqlType)
        throws SQLException {
        try {
            this.cstate.registerOutParameter(parameterName, sqlType);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void registerOutParameter(String parameterName, int sqlType,
        int scale) throws SQLException {
        try {
            this.cstate.registerOutParameter(parameterName, sqlType, scale);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void registerOutParameter(String parameterName, int sqlType,
        String typeName) throws SQLException {
        try {
            this.cstate.registerOutParameter(parameterName, sqlType, typeName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setArray(int i, Array x) throws SQLException {
        try {
            this.cstate.setArray(i, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setAsciiStream(int parameterIndex, InputStream x, int length)
        throws SQLException {
        try {
            this.cstate.setAsciiStream(parameterIndex, x, length);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setAsciiStream(String parameterName, InputStream x, int length)
        throws SQLException {
        try {
            this.cstate.setAsciiStream(parameterName, x, length);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setBigDecimal(int parameterIndex, BigDecimal x)
        throws SQLException {
        try {
            this.cstate.setBigDecimal(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setBigDecimal(String parameterName, BigDecimal x)
        throws SQLException {
        try {
            this.cstate.setBigDecimal(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setBinaryStream(int parameterIndex, InputStream x, int length)
        throws SQLException {
        try {
            this.cstate.setBinaryStream(parameterIndex, x, length);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setBinaryStream(String parameterName, InputStream x, int length)
        throws SQLException {
        try {
            this.cstate.setBinaryStream(parameterName, x, length);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setBlob(int i, Blob x) throws SQLException {
        try {
            this.cstate.setBlob(i, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setBoolean(int parameterIndex, boolean x)
        throws SQLException {
        try {
            this.cstate.setBoolean(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setBoolean(String parameterName, boolean x)
        throws SQLException {
        try {
            this.cstate.setBoolean(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setByte(int parameterIndex, byte x) throws SQLException {
        try {
            this.cstate.setByte(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setByte(String parameterName, byte x) throws SQLException {
        try {
            this.cstate.setByte(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setBytes(int parameterIndex, byte[] x)
        throws SQLException {
        try {
            this.cstate.setBytes(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setBytes(String parameterName, byte[] x)
        throws SQLException {
        try {
            this.cstate.setBytes(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setCharacterStream(int parameterIndex, Reader reader, int length)
        throws SQLException {
        try {
            this.cstate.setCharacterStream(parameterIndex, reader, length);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setCharacterStream(String parameterName, Reader reader,
        int length) throws SQLException {
        try {
            this.cstate.setCharacterStream(parameterName, reader, length);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setClob(int i, Clob x) throws SQLException {
        try {
            this.cstate.setClob(i, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setCursorName(String name) throws SQLException {
        try {
            this.cstate.setCursorName(name);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setDate(int parameterIndex, Date x) throws SQLException {
        try {
            this.cstate.setDate(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setDate(int parameterIndex, Date x, Calendar cal)
        throws SQLException {
        try {
            this.cstate.setDate(parameterIndex, x, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setDate(String parameterName, Date x) throws SQLException {
        try {
            this.cstate.setDate(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setDate(String parameterName, Date x, Calendar cal)
        throws SQLException {
        try {
            this.cstate.setDate(parameterName, x, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setDouble(int parameterIndex, double x)
        throws SQLException {
        try {
            this.cstate.setDouble(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setDouble(String parameterName, double x)
        throws SQLException {
        try {
            this.cstate.setDouble(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setEscapeProcessing(boolean enable) throws SQLException {
        try {
            this.cstate.setEscapeProcessing(enable);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setFetchDirection(int direction) throws SQLException {
        try {
            this.cstate.setFetchDirection(direction);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setFetchSize(int rows) throws SQLException {
        try {
            this.cstate.setFetchSize(rows);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setFloat(int parameterIndex, float x) throws SQLException {
        try {
            this.cstate.setFloat(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setFloat(String parameterName, float x)
        throws SQLException {
        try {
            this.cstate.setFloat(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setInt(int parameterIndex, int x) throws SQLException {
        try {
            this.cstate.setInt(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setInt(String parameterName, int x) throws SQLException {
        try {
            this.cstate.setInt(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setLong(int parameterIndex, long x) throws SQLException {
        try {
            this.cstate.setLong(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setLong(String parameterName, long x) throws SQLException {
        try {
            this.cstate.setLong(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setMaxFieldSize(int max) throws SQLException {
        try {
            this.cstate.setMaxFieldSize(max);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setMaxRows(int max) throws SQLException {
        try {
            this.cstate.setMaxRows(max);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setNull(int parameterIndex, int sqlType)
        throws SQLException {
        try {
            this.cstate.setNull(parameterIndex, sqlType);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setNull(int paramIndex, int sqlType, String typeName)
        throws SQLException {
        try {
            this.cstate.setNull(paramIndex, sqlType, typeName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setNull(String parameterName, int sqlType)
        throws SQLException {
        try {
            this.cstate.setNull(parameterName, sqlType);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setNull(String parameterName, int sqlType, String typeName)
        throws SQLException {
        try {
            this.cstate.setNull(parameterName, sqlType, typeName);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setObject(int parameterIndex, Object x)
        throws SQLException {
        try {
            this.cstate.setObject(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setObject(int parameterIndex, Object x, int targetSqlType)
        throws SQLException {
        try {
            this.cstate.setObject(parameterIndex, x, targetSqlType);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setObject(int parameterIndex, Object x, int targetSqlType,
        int scale) throws SQLException {
        try {
            this.cstate.setObject(parameterIndex, x, targetSqlType, scale);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setObject(String parameterName, Object x)
        throws SQLException {
        try {
            this.cstate.setObject(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setObject(String parameterName, Object x, int targetSqlType)
        throws SQLException {
        try {
            this.cstate.setObject(parameterName, x, targetSqlType);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setObject(String parameterName, Object x, int targetSqlType,
        int scale) throws SQLException {
        try {
            this.cstate.setObject(parameterName, x, targetSqlType, scale);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setQueryTimeout(int seconds) throws SQLException {
        try {
            this.cstate.setQueryTimeout(seconds);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setRef(int i, Ref x) throws SQLException {
        try {
            this.cstate.setRef(i, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setShort(int parameterIndex, short x) throws SQLException {
        try {
            this.cstate.setShort(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setShort(String parameterName, short x)
        throws SQLException {
        try {
            this.cstate.setShort(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setString(int parameterIndex, String x)
        throws SQLException {
        try {
            this.cstate.setString(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setString(String parameterName, String x)
        throws SQLException {
        try {
            this.cstate.setString(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setTime(int parameterIndex, Time x) throws SQLException {
        try {
            this.cstate.setTime(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setTime(int parameterIndex, Time x, Calendar cal)
        throws SQLException {
        try {
            this.cstate.setTime(parameterIndex, x, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setTime(String parameterName, Time x) throws SQLException {
        try {
            this.cstate.setTime(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setTime(String parameterName, Time x, Calendar cal)
        throws SQLException {
        try {
            this.cstate.setTime(parameterName, x, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setTimestamp(int parameterIndex, Timestamp x)
        throws SQLException {
        try {
            this.cstate.setTimestamp(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)
        throws SQLException {
        try {
            this.cstate.setTimestamp(parameterIndex, x, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setTimestamp(String parameterName, Timestamp x)
        throws SQLException {
        try {
            this.cstate.setTimestamp(parameterName, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setTimestamp(String parameterName, Timestamp x, Calendar cal)
        throws SQLException {
        try {
            this.cstate.setTimestamp(parameterName, x, cal);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    /*
        public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
            try {
                this.cstate.setUnicodeStream(parameterIndex, x, length);
            }catch(Exception ex) {
                throw new SQLException(ex);
            }
        }
    */
    public void setURL(int parameterIndex, URL x) throws SQLException {
        try {
            this.cstate.setURL(parameterIndex, x);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public void setURL(String parameterName, URL val) throws SQLException {
        try {
            this.cstate.setURL(parameterName, val);
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }

    public boolean wasNull() throws SQLException {
        try {
            return this.cstate.wasNull();
        } catch (Exception ex) {
            throw new SQLException(ex);
        }
    }
}
